package com.yuanfeng.job.job;


import com.yuanfeng.job.service.OdbRangeStatisticsJobService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author lxt
 *统计每分真实交易和自身交易总销售额
 */
public class odbStatisticsMonthJob implements BaseJob {

    private static final Logger logger = LoggerFactory.getLogger(odbStatisticsMonthJob.class);

    @Autowired
   private OdbRangeStatisticsJobService odbRangeStatisticsJobService;
    
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM");
		Calendar c = Calendar.getInstance();
		c.setTime(new Date());
		c.add(Calendar.MONTH, -1);
		Date m3 = c.getTime();
		String finishTime = dateformat.format(m3);
		logger.info("插入统计时间" + finishTime);
		Integer staut = odbRangeStatisticsJobService.queryOdbStatisticsMonthJobJob(finishTime);
	}
}
